<%--
  Created by IntelliJ IDEA.
  User: maybe
  Date: 2015-10-14
  Time: 08:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<jsp:useBean id="newsService" class="com.news.service.NewsService"></jsp:useBean>

<html>
<head>
    <title></title>
</head>
<body>

  <%
    String news_id=request.getParameter("news_id");
    String news_ids=request.getParameter("news_ids");
    String channel_id=request.getParameter("channel_id");
    if(news_id!=""&&news_id!=null){
      boolean s= newsService.deleteNews(Long.parseLong(request.getParameter("news_id")));
    }else{
      String[] arrayId=news_ids.split(",");
      for(String t:arrayId){
        boolean s=newsService.deleteNews(Long.parseLong(t));
      }
    }
    response.sendRedirect("list.jsp?channel_id="+channel_id);
  %>
  <%%>
</body>
</html>
